//
//  DetailsViewController.m
//  大轮胎
//
//  Created by 曹亮 on 2017/3/29.
//  Copyright © 2017年 zyc. All rights reserved.
//http://lscy4.caeac.com.cn/api/product.php?appkey=1138&id=10&token=



#import "DetailsViewController.h"
#import "DetailseView.h"
#import "YCNetWork.h"
#import "DetailseModel.h"
@interface DetailsViewController ()
{
    DetailseView*detailseview;
}
@end

@implementation DetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //数据
    NSString*str=[NSString stringWithFormat:@"http://lscy4.caeac.com.cn/api/product.php?appkey=1138&id=%@&token=",self.idss];
 
    //解析数据
    [ YCNetWork postWithURLString:str parameters:nil success:^(id data) {
        
        DetailseModel*mo=[[DetailseModel alloc]init];
        
        [mo setValuesForKeysWithDictionary:data];
        
        detailseview.labelStr=mo.name;
        
        detailseview.priceStr=mo.price;
        
        detailseview.price_Str=mo.price_yj;
        
        for (NSDictionary*dic in mo.photo_string) {
            
            DetailseModell*ll=[[DetailseModell alloc]init];
            
            [ll setValuesForKeysWithDictionary:dic];
            
            detailseview.imgStr = ll.img;
        }
        
        
    } failure:^(NSError *error) {
        
        
    }];
    

    detailseview=[[DetailseView alloc]initWithFrame:self.view.frame];
    
    self.view = detailseview;
    

    
    
  }

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
